﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HarveyNash.RefactoringAndCodeSmell.Refactoring.ConsolidateConditionalFragments
{
    public class After
    {
        public bool CandidateRejected(TestResult result)
        {
            if (UnderLowerBound(result))
                return true;
            if (MeetsExpectation(result))
                return false;            
            return true;
        }

        private static bool UnderLowerBound(TestResult result)
        {
            return result.IQScore < 100 || result.EnglishScore < 2 || result.TechnicalScore < 3;
        }

        private static bool MeetsExpectation(TestResult result)
        {
            return result.IQScore > 120 && (result.EnglishScore * 2 + result.TechnicalScore) / 3 >= 5;
        }        
    }
}
